﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Xml;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.DataAccess.Common
{
    public class DataAccessErrorCode
    {

        public const string Error = "FASDAC-Error-1001";
        public const string NullValue = "FASDAC-NullValue-1002";

        public class DataType
        {
            public const string NullValue           = "FASDAC-DataType-1001";
            public const string TypeCastError       = "FASDAC-DataType-1002";
            public const string NotSupportedType    = "FASDAC-DataType-1003";
        }

        public class Metadata
        {
            public const string Error               = "FASDAC-Metadata-1001";
            public const string RTPGetMetadataError = "FASDAC-Metadata-2001";
            public class CDO
            {
                public const string MetadataError   = "FASDAC-CDOMetadata-1001";
            }

            public class DQ
            {
                public const string MetadataError = "FASDAC-DQMetadata-1001";
            }
        }

        public class Database
        {
            public const string NullValue                   = "FASDAC-Database-1001";
            public const string ParameterError              = "FASDAC-Database-1002";
            public const string NotSupportedDatabaseError   = "FASDAC-Database-1003";
            public const string CanNotGetDBInstanceError    = "FASDAC-Database-2001";
            public const string ConfigKeyError              = "FASDAC-Database-2002";
        }

        public class DataContext
        {
            public const string Error               = "FASDAC-DataContext-1001";
        }

        public class ValidInput
        {
            public const string ValidInputError     = "FASDAC-ValidInput-1001";
            public const string NotSupportedType    = "FASDAC-ValidInput-1002";
        }

        public class ORM
        {
            public const string Error               = "FASDAC-ORM-1001";
            public const string NotFindProperty     = "FASDAC-ORM-1002";
        }

        public class SQLDOM
        {
            public const string Error                   = "FASDAC-SQLDOM-1001";
            public const string NotSupportedFieldType   = "FASDAC-SQLDOM-1002";
        }

        public class PlugIn
        {
            public const string Error               = "FASDAC-PlugIn-1001";

            public class Authority
            {
                public const string Error           = "FASDAC-AuthorityPlugIn-1001";
                public const string PermissionError = "FASDAC-AuthorityPlugIn-1002";
            }

            public class ChangeLog
            {
                public const string Error           = "FASDAC-ChangeLogPlugIn-1001";
            }

            public class StateMachine
            {
                public const string Error           = "FASDAC-StateMachinePlugIn-1001";
            }

        }

        public class DataQuery
        {
            public const string Error               = "FASDAC-DataQuery-1000";
            public const string NullValue           = "FASDAC-DataQuery-1001";
            public const string QueryPlanError      = "FASDAC-DataQuery-1002";
            public const string UnvalidParam        = "FASDAC-DataQuery-1003";
        }
        public class DataObject
        {
            public const string NullValue           = "FASDAC-DataObject-1001";
        }

        public class CompositeDataObject
        {
            public const string Error               = "FASDAC-CompositeDataObject-1000";
            public const string NullValue           = "FASDAC-CompositeDataObject-1001";
            public const string AffectedRowsError   = "FASDAC-CompositeDataObject-1002";
            public const string ElementError        = "FASDAC-CompositeDataObject-1003";
            public const string ColumnError         = "FASDAC-CompositeDataObject-1004";
            public const string AssociationError    = "FASDAC-CompositeDataObject-1005";
            public const string UnableCastToTRecord = "FASDAC-CompositeDataObject-1006";
            public const string NoTimestampField    = "FASDAC-CompositeDataObject-1007";
        }

        public class StateMachine
        {
            public const string FireEventError          = "FASDAC-StateMachine-0001";
            public const string MetadataError           = "FASDAC-StateMachine-1000";
            public const string NullValue               = "FASDAC-StateMachine-1001";
            public const string TryGetInitKeyError      = "FASDAC-StateMachine-2001";
            public const string FireBeforeSaveError     = "FASDAC-StateMachine-2002";
            public const string FireStateChangingError  = "FASDAC-StateMachine-2003";
        }

        public class ExpressRTP
        {
            public const string Error       = "FASDAC-ExpressRTP-1001";
        }

        public class Sharding
        {
            public const string Error       = "FASDAC-Sharding-1001";
            public const string NullValue   = "FASDAC-Sharding-1002";
        }

        public class Create
        {
            public const string Error               = "FASDAC-Create-1001";
            public const string NullValue           = "FASDAC-Create-1002";
            public const string InsertFieldError    = "FASDAC-Create-1003";
        }
        public class Retrieve
        {
            public const string Error           = "FASDAC-Retrieve-1001";
            public const string NullValue       = "FASDAC-Retrieve-1002";
            public const string PagingError     = "FASDAC-Retrieve-1003";
            
        }
        public class Update
        {
            public const string Error               = "FASDAC-Update-1001";
            public const string NullValue           = "FASDAC-Update-1002";
            public const string UnconditionalError  = "FASDAC-Update-1003";
        }
        public class Delete
        {
            public const string Error       = "FASDAC-Delete-1001";
            public const string NullValue   = "FASDAC-Delete-1002";
        }

        public class ChangeSet
        {
            public const string Error = "FASDAC-ChangeSet-1001";
        }
    }
}